-
Notifications
You must be signed in to change notification settings - Fork 1.6k
PowerShell Repair enhancements #5711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
src/PowerShell/Help/Microsoft.WinGet.Client/Repair-WinGetPackageManager.md
Outdated
Show resolved
Hide resolved
src/PowerShell/Help/Microsoft.WinGet.Client/Repair-WinGetPackageManager.md
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Commands/WinGetPackageManagerCommand.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs
Outdated
Show resolved
Hide resolved
src/PowerShell/Microsoft.WinGet.Client.Engine/Helpers/AppxModuleHelper.cs
Outdated
Show resolved
Hide resolved
| /// <param name="includePrerelease">Include prerelease versions.</param> | ||
| /// <param name="result">The resulting version.</param> | ||
| /// <returns>True if a matching version was found.</returns> | ||
| private static bool TryGetLatestMatchingVersion(IEnumerable<WinGetVersion> versions, string pattern, bool includePrerelease, out WinGetVersion result) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private static bool TryGetLatestMatchingVersion(IEnumerable<WinGetVersion> versions, string pattern, bool includePrerelease, out WinGetVersion result) | |
| private static bool TryGetLatestMatchingVersion(IEnumerable<WinGetVersion> versions, string pattern, bool includePrerelease, out WinGetVersion? result) |
Because you very clearly return a null in some cases. You can annotate with the appropriate attribute to mark it as not null when returning true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention was that you would use the NotNullWhen attribute and not need the ! inside the conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also remove the ! from the null! in the function now.
… user/amelbawa/4947
Register AppInstaller when using
AddProvisionPackageAsyncwhich was not registering the package prior to this PR change.Added a "best effort" approach to programmatically attempt to downloading the source2.msix and install it.
Keeping this as-is since the code includes a descriptive message. In my repro, the issue occurred when App Installer was not installed, and the code attempted to invoke winget.exe to check if the application was present.
This is not addressed in this PR. It's unclear which constraints should be relaxed, as the current implementation already attempts to ensure the requested parameters are satisfied. The Force flag is currently used to trigger
ForceTargetApplicationShutdownduring package addition, which appears appropriate. I recommend opening a separate issue to propose and discuss the desired behavior.Added support for leading and trailing wildcard:
1.2.*,1.2*,1.*2.3Related issues:
-Versionfor `Repair-WinGetPackageManager #5704Microsoft Reviewers: Open in CodeFlow